{extend name="public/base"}

{block name="x-body"}
    <div class="x-body">
      <blockquote class="layui-elem-quote">
        <span style="color: red;">提示：搜索日期条件将开始日和结束日填写完整，否则将为无效搜索</span>
      </blockquote>
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" method="get">
          <input class="layui-input" placeholder="开始日" name="start" value="{$search_key.start}" id="start">
          <input class="layui-input" placeholder="截止日" name="end" value="{$search_key.end}" id="end">
          <div class="layui-input-inline">
            <select name="pay_status">
              <option value="">支付状态</option>
              <option value="1" {$search_key.pay_status == 1 ? 'selected' : ''}>已支付</option>
              <option value="0" {$search_key.pay_status === '0' ? 'selected' : ''}>未支付</option>
            </select>
          </div>
          <div class="layui-input-inline">
            <select name="shipping_status">
              <option value="">发货状态</option>
              <option value="0" {$search_key.shipping_status === '0' ? 'selected' : ''}>未发货</option>
              <option value="2" {$search_key.shipping_status == 2 ? 'selected' : ''}>部分发货</option>
              <option value="1" {$search_key.shipping_status == 1 ? 'selected' : ''}>已发货</option>
            </select>
          </div>
          <div class="layui-input-inline">
            <select name="pay_code">
              <option value="">支付方式</option>
              {volist name="list.pay" id="v"}
                <option value="{$v.code}" {$search_key.pay_code == $v.code ? 'selected' : ''}>{$v.name}</option>
              {/volist}
            </select>
          </div>
          <div class="layui-input-inline">
            <select name="order_status">
              <option value="">订单状态</option>
              <option value="0" {$search_key.order_status === '0' ? 'selected' : ''}>未确认</option>
              <option value="1" {$search_key.order_status == 1 ? 'selected' : ''}>已确认</option>
              <option value="2" {$search_key.order_status == 2 ? 'selected' : ''}>已收货</option>
              <option value="3" {$search_key.order_status == 3 ? 'selected' : ''}>已取消</option>
              <option value="4" {$search_key.order_status == 4 ? 'selected' : ''}>已完成</option>
              <option value="5" {$search_key.order_status == 5 ? 'selected' : ''}>已作废</option>
            </select>
          </div>
          <input type="text" name="order_sn"  placeholder="请输入订单号" autocomplete="off" class="layui-input" value="{$search_key.order_sn}">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock style="height: 40px;">
        <span class="x-right" style="line-height:40px">共有数据：{$list.list -> total()} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>ID</th>
            <th>订单编号</th>
            <th>收货人</th>
            <th>总金额</th>
            <th>应付金额</th>
            <th>订单状态</th>
            <th>支付状态</th>
            <th>发货状态</th>
            <th>支付方式</th>
            <th>配送方式</th>
            <th>下单时间</th>
            <th>操作</th>
            </tr>
        </thead>
        <tbody>
          {volist name="list.list" id="v"}
            <tr>
              <td>{$v.id}</td>
              <td>{$v.order_sn}</td>
              <td>{$v.consignee}:{$v.mobile}</td>
              <td>
                {if $v.integral}
                  <img src="__STATIC__/common/images/integral.png" width="20" alt=""> {$v.integral}
                {else /}
                  <img src="__STATIC__/common/images/money.png" width="20" alt=""> {$v.total_amount}
                {/if}
              </td>
              <td>
                {if $v.integral}
                <img src="__STATIC__/common/images/integral.png" width="20" alt=""> {$v.integral}
                {else /}
                <img src="__STATIC__/common/images/money.png" width="20" alt=""> {$v.order_amount}
                {/if}
              </td>
              <td>
                {switch name="v.order_status"}
                  {case value="0"}未确定{/case}
                  {case value="1"}已确定{/case}
                  {case value="2"}已收货{/case}
                  {case value="3"}已取消{/case}
                  {case value="4"}已完成{/case}
                  {case value="5"}已作废{/case}
                {/switch}
              </td>
              <td>{$v.pay_status == 1 ? '已支付' : '未支付'}</td>
              <td>
                {if $v.shipping_status == 1}
                  已发货
                {elseif $v.shipping_status == 2}
                  部分发货
                {else /}
                  未发货
                {/if}
              </td>
              <td>{$v.pay_name}</td>
              <td>{$v.shipping_name}</td>
              <td>{$v.add_time|date="Y-m-d H:i"}</td>
              <td class="td-manage">
                <a title="订单查看"  onclick="x_admin_show('订单编辑','{:url(\'orders/order_cat\', [\'id\' => $v.id])}')" href="javascript:;">
                  <i class="layui-icon">&#xe63c;</i>
                </a>
              </td>
            </tr>
          {/volist}
        </tbody>
      </table>
      <div class="page">
        {$list.list -> render()|raw}
      </div>

    </div>
{/block}